//该改文件当前目录下，创建新的文件夹

const fs=require("fs")
const path=require("path")

const dirPath=path.join(__dirname,"test")
fs.mkdirSync(dirPath)

//复制文件
let filePath=path.join(__dirname,"test.txt")
let writePath=path.join(__dirname,"test/copy.txt")
let reader=fs.createReadStream(filePath);
let writer=fs.createWriteStream(writePath)

reader.pipe(writer)